#答题卡评分
import pandas as pd

df=pd.DataFrame(['0,2,2,4,5,6,7','3,1,3,4,0,6,7','4,8,3,4,5,0,7'],index=['a','b','c'],columns=['x'])
print(df)

#切开
ndf=df['x'].str.split(',',expand=True) # expand使结果拆分成不同的列
print(ndf)

# 按列聚合
print(ndf.astype(int).sum(axis=1)) # astype将字符串改为数字 axis=1横着聚合
